package com.sec.android.app.myfiles.fragment.home;

import com.sec.android.app.myfiles.module.abstraction.FileRecord;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.reflect.internal.WhiteboxImpl;

/**
 * Created by jaebae on 2016-12-05.
 */

public class testHomeFragment {
    private HomeFragment mFragment;

    @Before
    public void setUp() throws Exception {
        mFragment = new HomeFragment();
    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void testOnCreate() {
        try {
            mFragment.onCreate(null);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    @Test
    public void testOnCreateView() {
        try {
            mFragment.onCreateView(null, null, null);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testOnViewCreated() {
        try {
            mFragment.onViewCreated(null, null);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testSetTwFluidScroll() {
        try {
            WhiteboxImpl.invokeMethod(mFragment, "setTwFluidScroll");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testSetTwGoToTop() {
        try {
            WhiteboxImpl.invokeMethod(mFragment, "setTwGoToTop");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testUpdateMenuView() {
        try {
            WhiteboxImpl.invokeMethod(mFragment, "updateMenuView");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testOnConfigurationChanged() {
        try {
            mFragment.onConfigurationChanged(null);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testOnResume() {
        try {
            mFragment.onResume();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testGetListItemCount() {
        try {
            mFragment.getListItemCount();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testOnPause() {
        try {
            mFragment.onPause();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testOnStop() {
        try {
            mFragment.onStop();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    @Test
    public void testOnDestroy() {
        try {
            mFragment.onDestroy();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testIsItemClickValid() {
        try {
            WhiteboxImpl.invokeMethod(mFragment, "isItemClickValid", 0);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }



    @Test
    public void test_OnItemClick() {
        try {
            WhiteboxImpl.invokeMethod(mFragment, "_onItemClick", PowerMockito.mock(FileRecord.class));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
